package com.chance.cc.crawler.development.command.schedule.vm;

import com.chance.cc.crawler.development.command.job.domain.vm.dcdapp.simple.DcdappWebPraiseSimpleCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.schedule.CrawlerJobScheduleCommand;

/**
 * @Author Zhao.Hhuan
 * @Date Create in 2021/3/3 13:14
 * @Description
 *      懂车帝 调度
 **/
public class DcdappCrawlerJobSchedule {

    private static CrawlerJobScheduleCommand crawlerJobScheduleCommand =
            new CrawlerJobScheduleCommand("192.168.1.215",9589);


    public static void main(String[] args) {
//        deleteCrawlerJob(DcdappWebForumRealtimeCrawlerSchedulerJob.publishCrawlerScheduleJobInfo().generateCrawlerTriggerKey());
//        deleteCrawlerJob(DcdappWebPraiseRealtimeCrawlerSchedulerJob.publishCrawlerScheduleJobInfo().generateCrawlerTriggerKey());
//        deleteCrawlerJob(DcdappWebPraiseTraceCrawlerSchedulerJob.publishCrawlerScheduleJobInfo().generateCrawlerTriggerKey());
//        deleteCrawlerJob(DcdappWebForumTraceCrawlerSchedulerJob.publishCrawlerScheduleJobInfo().generateCrawlerTriggerKey());

        repubflishCrawlerJobInfo(DcdappWebPraiseSimpleCrawlerSchedulerJob.publishCrawlerScheduleJobInfo().generateCrawlerTriggerKey());
//        repubflishCrawlerJobInfo(DcdappWebForumSimpleCrawlerSchedulerJob.publishCrawlerScheduleJobInfo().generateCrawlerTriggerKey());
    }

    /**
     * 重新发布调度
     * @param triggerKey
     */
    public static void repubflishCrawlerJobInfo(String triggerKey){
        crawlerJobScheduleCommand.republishCrawlerJob(triggerKey,"crawler_dev_host");
    }

    /**
     * 去除调度
     * @param triggerKey
     */
    public static void deleteCrawlerJob(String triggerKey){
        crawlerJobScheduleCommand.deleteCrawlerJob(triggerKey,"crawler_dev_host");
    }

}
